package base

import (
	"fmt"
	"github.com/tietang/props/kvs"
	"red-packet-war/infra"
)

var props kvs.ConfigSource

// Props Outward exposure function
func Props() kvs.ConfigSource {
	return props
}

type PropsStarter struct {
	infra.BaseStarter
}

func (p *PropsStarter) Init(ctx infra.StarterContext) {
	props = ctx.Props()
	fmt.Println("init config is", props.GetDefault("app.name", "项目名称"))
}
